Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: rename ark_project into arkproject and wallet_kit into walletkit #443

Merged

Conversation

ptisserand
Copy link
Collaborator

@ptisserand ptisserand commented Feb 3, 2025

Due to publishing issue:

  • Rename ark_project package into arkproject
  • Rename wallet_kit package into walletkit

Summary by CodeRabbit

  • Documentation

    • Updated guides to reflect new naming conventions and adjusted dependency version details.
  • Refactor

    • Unified dependency names (e.g., removing underscores) and updated asset & import references for consistency.
    • Streamlined component structures to improve maintainability.
  • Chores

    • Applied minor text formatting fixes for clarity.

Copy link

docs-page bot commented Feb 3, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/focustree/starknet.dart~443

Documentation is deployed and generated using docs.page.

Copy link
Contributor

coderabbitai bot commented Feb 3, 2025

Walkthrough

The pull request refactors various parts of the codebase by standardizing naming conventions. The dependency and directory references for the wallet kit have been changed from wallet_kit to walletkit, and similarly, references for ark_project have been updated to arkproject. Additionally, there are adjustments in import paths, asset paths, and plugin registrations. Minor documentation fixes, such as the correction from "FlutterActity" to "FlutterActivity" and a downgrade in the Starknet Devnet version, are also included. A new callback in the password screen and a shift to relative imports in some files are noted.

Changes

File(s) Change Summary
docs/…/mobile-wallet.mdx, docs/…/how-to-contribute.mdx Renamed dependency/directory from wallet_kit to walletkit; fixed "FlutterActity" typo; downgraded Starknet Devnet version from 0.5.0 to 0.1.2.
examples/nft_marketplace/…, examples/wallet_app/… Updated import statements from wallet_kit to walletkit and from ark_project to arkproject; adjusted dependency names in pubspec.yaml files.
packages/ark_project/… Renamed package and import reference from ark_project to arkproject.
packages/wallet_kit/ios/…GeneratedPluginRegistrant.m, packages/wallet_kit/macos/Flutter/GeneratedPluginRegistrant.swift Updated plugin registration by replacing FLTWebViewFlutterPlugin with WebViewFlutterPlugin.
packages/wallet_kit/lib/{services/wallet_service.dart, wallet_kit.dart, ui/button.dart, ui/input.dart, ui/modal.dart} Changed absolute imports to relative ones; updated naming from wallet_kit to walletkit; converted ModalLayout from a stateful to a stateless widget.
packages/wallet_kit/lib/wallet_screens/{add_wallet_screen.dart, create_wallet_screen.dart, password_screen.dart, protect_wallet_screen.dart, recover_wallet_screen.dart, settings_screen.dart} Reorganized import statements for modularity and dependency renaming; added a callback parameter in PasswordScreen and integrated WalletService.newSeedPhrase() in the add wallet screen.
packages/wallet_kit/lib/wallet_state/{wallet_provider.dart, wallet_state.dart} Updated import paths to use relative references and reorganized wallet state management files.
packages/wallet_kit/lib/widgets/… Adjusted multiple widget files’ import statements; updated asset paths to reflect the new walletkit naming; reorganized module dependencies in components like account_address, icon, NFT details/list, send ETH button, token icon/list, wallet body, wallet list, and wallet selector.
packages/wallet_kit/pubspec.yaml Renamed the package from wallet_kit to walletkit and updated dependency references from ark_project to arkproject.
packages/wallet_kit/test/utils/{format_address_test.dart, group_by_test.dart} Changed import paths to reflect renaming from wallet_kit to walletkit and consolidated utility imports.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant B as CreateNewWalletButton
  participant WS as WalletService
  participant C as CreateWalletScreen

  U->>B: Tap "Create Wallet" button
  B->>WS: Call newSeedPhrase()
  WS-->>B: Return new seed phrase
  B->>C: Navigate to CreateWalletScreen with seed phrase
Loading

Possibly related PRs

  • fix: secure_store compatible with flutter 3.27.1 #429: The changes in the main PR regarding the renaming of the wallet_kit dependency to walletkit are directly related to the modifications in the retrieved PR, which also addresses the wallet_kit component and includes a fix for the ProtectWalletScreen in the same context.
  • docs: Add wallet app tutorial #421: The changes in the main PR, which involve renaming the wallet_kit dependency to walletkit, are directly related to the changes in the retrieved PR, where the tutorial also references the wallet_kit dependency, indicating a consistent naming convention across documentation.
  • fix: update wallet_app tutorial #431: The changes in the main PR, which focus on renaming the wallet_kit dependency to walletkit in documentation and code examples, are related to the retrieved PR that also updates references to wallet_kit in the context of the wallet application tutorial. Both PRs involve modifications to the same dependency name, indicating a direct connection at the code level.

Poem

I’m a bunny coding through the night,
Hopping along with names shining bright.
wallet_kit now hops as walletkit in style,
With every refactor, I grin all the while.
Arks and tokens join my playful rave,
In a world of clean code—oh, how I crave! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f8e9204 and 7f1b32b.

📒 Files selected for processing (2)
  • examples/nft_marketplace/macos/Flutter/GeneratedPluginRegistrant.swift (1 hunks)
  • examples/wallet_app/macos/Flutter/GeneratedPluginRegistrant.swift (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • examples/nft_marketplace/macos/Flutter/GeneratedPluginRegistrant.swift
  • examples/wallet_app/macos/Flutter/GeneratedPluginRegistrant.swift

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ptisserand ptisserand marked this pull request as ready for review February 3, 2025 15:48
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🔭 Outside diff range comments (1)
packages/wallet_kit/lib/wallet_screens/create_wallet_screen.dart (1)

125-126: Remove the ignore comment and handle the async context properly.

The use_build_context_synchronously lint ignore comment suggests a potential issue with using BuildContext after an asynchronous gap.

Apply this diff to handle the async context properly:

-        // ignore: use_build_context_synchronously
-        ScaffoldMessenger.of(context).showSnackBar(
+        if (context.mounted) {
+          ScaffoldMessenger.of(context).showSnackBar(
+        }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a9b006 and f8e9204.

📒 Files selected for processing (38)
  • docs/examples/mobile-wallet.mdx (5 hunks)
  • docs/how-to-contribute.mdx (2 hunks)
  • examples/nft_marketplace/lib/main.dart (1 hunks)
  • examples/nft_marketplace/lib/screens/home_screen.dart (1 hunks)
  • examples/nft_marketplace/pubspec.yaml (1 hunks)
  • examples/wallet_app/lib/main.dart (1 hunks)
  • examples/wallet_app/lib/screens/home_screen.dart (1 hunks)
  • examples/wallet_app/pubspec.yaml (1 hunks)
  • packages/ark_project/example/ark_example.dart (1 hunks)
  • packages/ark_project/pubspec.yaml (1 hunks)
  • packages/wallet_kit/ios/Runner/GeneratedPluginRegistrant.m (2 hunks)
  • packages/wallet_kit/lib/services/wallet_service.dart (1 hunks)
  • packages/wallet_kit/lib/ui/button.dart (1 hunks)
  • packages/wallet_kit/lib/ui/input.dart (1 hunks)
  • packages/wallet_kit/lib/ui/modal.dart (1 hunks)
  • packages/wallet_kit/lib/wallet_kit.dart (1 hunks)
  • packages/wallet_kit/lib/wallet_screens/add_wallet_screen.dart (1 hunks)
  • packages/wallet_kit/lib/wallet_screens/create_wallet_screen.dart (1 hunks)
  • packages/wallet_kit/lib/wallet_screens/password_screen.dart (1 hunks)
  • packages/wallet_kit/lib/wallet_screens/protect_wallet_screen.dart (1 hunks)
  • packages/wallet_kit/lib/wallet_screens/recover_wallet_screen.dart (1 hunks)
  • packages/wallet_kit/lib/wallet_screens/settings_screen.dart (1 hunks)
  • packages/wallet_kit/lib/wallet_state/wallet_provider.dart (1 hunks)
  • packages/wallet_kit/lib/wallet_state/wallet_state.dart (1 hunks)
  • packages/wallet_kit/lib/widgets/account_address.dart (1 hunks)
  • packages/wallet_kit/lib/widgets/icon.dart (2 hunks)
  • packages/wallet_kit/lib/widgets/nft_details.dart (1 hunks)
  • packages/wallet_kit/lib/widgets/nft_list.dart (1 hunks)
  • packages/wallet_kit/lib/widgets/send_eth_button.dart (1 hunks)
  • packages/wallet_kit/lib/widgets/token_icon.dart (2 hunks)
  • packages/wallet_kit/lib/widgets/token_list.dart (1 hunks)
  • packages/wallet_kit/lib/widgets/wallet_body.dart (1 hunks)
  • packages/wallet_kit/lib/widgets/wallet_list.dart (1 hunks)
  • packages/wallet_kit/lib/widgets/wallet_selector.dart (1 hunks)
  • packages/wallet_kit/macos/Flutter/GeneratedPluginRegistrant.swift (1 hunks)
  • packages/wallet_kit/pubspec.yaml (2 hunks)
  • packages/wallet_kit/test/utils/format_address_test.dart (1 hunks)
  • packages/wallet_kit/test/utils/group_by_test.dart (1 hunks)
✅ Files skipped from review due to trivial changes (22)
  • packages/ark_project/pubspec.yaml
  • packages/wallet_kit/lib/wallet_state/wallet_provider.dart
  • packages/wallet_kit/lib/ui/input.dart
  • examples/nft_marketplace/lib/screens/home_screen.dart
  • packages/wallet_kit/lib/services/wallet_service.dart
  • packages/ark_project/example/ark_example.dart
  • packages/wallet_kit/test/utils/group_by_test.dart
  • packages/wallet_kit/lib/widgets/account_address.dart
  • examples/nft_marketplace/lib/main.dart
  • packages/wallet_kit/pubspec.yaml
  • packages/wallet_kit/lib/widgets/wallet_selector.dart
  • packages/wallet_kit/lib/widgets/nft_list.dart
  • packages/wallet_kit/lib/wallet_state/wallet_state.dart
  • examples/wallet_app/lib/screens/home_screen.dart
  • packages/wallet_kit/test/utils/format_address_test.dart
  • packages/wallet_kit/lib/wallet_screens/settings_screen.dart
  • packages/wallet_kit/lib/widgets/wallet_list.dart
  • packages/wallet_kit/lib/wallet_screens/recover_wallet_screen.dart
  • packages/wallet_kit/lib/ui/button.dart
  • packages/wallet_kit/lib/wallet_screens/protect_wallet_screen.dart
  • examples/wallet_app/lib/main.dart
  • packages/wallet_kit/lib/widgets/nft_details.dart
🔇 Additional comments (23)
packages/wallet_kit/lib/widgets/token_icon.dart (1)

3-4: LGTM! Import and asset path changes align with the package renaming.

The changes correctly implement:

  • Switching to relative imports for internal modules
  • Updating the asset path to use the new package name

Also applies to: 16-16

packages/wallet_kit/lib/widgets/icon.dart (1)

3-4: LGTM! Import and asset path changes align with the package renaming.

The changes correctly implement:

  • Switching to relative imports for internal modules
  • Updating the asset path to use the new package name

Also applies to: 27-27

packages/wallet_kit/lib/widgets/send_eth_button.dart (1)

5-9: LGTM! Import changes align with the package renaming.

The changes correctly implement:

  • Switching to relative imports for internal modules
  • Well-organized imports by category
packages/wallet_kit/lib/wallet_kit.dart (1)

6-7: LGTM! Import changes align with the package renaming.

The changes correctly implement switching to relative imports for internal modules.

packages/wallet_kit/lib/wallet_screens/add_wallet_screen.dart (2)

3-7: LGTM! Import changes align with package renaming.

The switch from absolute to relative imports is consistent with the PR objective of renaming the package.


39-41: Verify seed phrase generation.

The code now uses WalletService.newSeedPhrase() for generating seed phrases. Please ensure this method follows cryptographic best practices.

✅ Verification successful

Seed Phrase Generation Implementation Verified

  • The newSeedPhrase() method directly leverages bip39.generateMnemonic(), a widely adopted implementation of the BIP39 specification for mnemonic seed phrases.
  • Provided the bip39 package is up-to-date and correctly implemented, this approach adheres to cryptographic best practices.
  • No issues were detected in the seed phrase generation mechanism.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check seed phrase generation implementation
ast-grep --pattern $'class WalletService {
  $$$
  newSeedPhrase() {
    $$$
  }
  $$$
}'

Length of output: 90


Script:

#!/bin/bash
# Search for the definition of WalletService and its newSeedPhrase method in all Dart files
echo "Searching for WalletService definition..."
rg -n "class\s+WalletService" --glob "*.dart"
echo ""
echo "Searching for newSeedPhrase method..."
rg -n "newSeedPhrase\s*\(" --glob "*.dart"

Length of output: 694


Script:

#!/bin/bash
# Extract the implementation of the newSeedPhrase method from WalletService
sed -n '/static String newSeedPhrase/,/}/p' packages/wallet_kit/lib/services/wallet_service.dart

Length of output: 173

packages/wallet_kit/lib/widgets/token_list.dart (1)

4-7: LGTM! Import changes align with package renaming.

The switch from absolute to relative imports is consistent with the PR objective of renaming the package.

packages/wallet_kit/lib/widgets/wallet_body.dart (1)

4-8: LGTM! Import changes align with package renaming.

The switch from absolute to relative imports is consistent with the PR objective of renaming the package.

packages/wallet_kit/lib/wallet_screens/create_wallet_screen.dart (1)

5-7: LGTM! Import changes align with package renaming.

The switch from absolute to relative imports is consistent with the PR objective of renaming the package.

packages/wallet_kit/lib/wallet_screens/password_screen.dart (2)

5-7: LGTM! Import statements updated correctly.

The change from absolute to relative imports aligns with the package renaming and improves modularity.


119-120: Good enhancement to the PasswordScreen component.

The addition of an optional callback parameter with a sensible default improves the component's reusability.

Also applies to: 126-127

packages/wallet_kit/lib/ui/modal.dart (2)

2-3: LGTM! Import statements simplified.

The removal of the wallet_kit import and addition of a direct button import aligns with the package renaming effort.


82-126: Good cleanup of commented code.

Removing the commented-out StatefulWidget implementation improves code maintainability.

examples/wallet_app/pubspec.yaml (1)

12-12: LGTM! Package dependency renamed correctly.

The dependency has been updated from wallet_kit to walletkit as intended.

examples/nft_marketplace/pubspec.yaml (1)

31-31: LGTM! Package dependencies renamed correctly.

Both dependencies have been updated as intended:

  • ark_projectarkproject
  • wallet_kitwalletkit

Also applies to: 35-35

docs/how-to-contribute.mdx (2)

100-100: Ensure Consistent Package Renaming for Walletkit Documentation.
The change from wallet_kit to walletkit in the repository structure is clearly reflected here. Please double-check that all related documentation references throughout the project have been updated accordingly.


122-122: Confirm the Starknet Devnet Version Downgrade.
The documentation now states Starknet Devnet version as 0.1.2. Given this is a significant downgrade from previously mentioned versions, please verify that this change is intentional and that no compatibility issues exist with the current setup instructions.

docs/examples/mobile-wallet.mdx (5)

20-20: Update Dependency Command with Renamed Package.
The dependency addition command now uses walletkit instead of wallet_kit, which aligns with the PR objective. Ensure that users update their pubspec.yaml accordingly if they copy this command for their projects.


47-47: Clarify Android minSdk Requirement Note.
The note now correctly mentions that the secure_store package (used by walletkit) requires a minimum SDK of 23. This explicit instruction is helpful—just confirm that all platforms are covered by similar documentation if needed.


102-102: Verify Updated Import Statement in Main Function Block.
The import statement now reads import 'package:walletkit/wallet_kit.dart';, reflecting the package renaming. Please ensure that the corresponding file name and package configuration remain consistent with this change.


147-147: Ensure Consistency in Import Usage Across Code Blocks.
The updated import in the second main code block also uses walletkit, which is consistent. It might be worth checking that the file name being imported (wallet_kit.dart) aligns with the new package naming conventions—or if further renaming is required.


198-198: Document Pre-Built Layout Integration from Walletkit.
The instructions now clearly state to create a screens/ folder and add a home_screen.dart file using pre-built layouts from walletkit (including components like WalletSelector, AccountAddress, etc.). This guidance is useful; please verify that all required components are correctly exported from the walletkit package.

packages/wallet_kit/ios/Runner/GeneratedPluginRegistrant.m (1)

27-28: Verify WebView Flutter plugin header path and registration.

The changes to both the import statement and plugin registration are consistent with the macOS implementation. Let's verify the header file path and plugin registration.

Also applies to: 39-39

✅ Verification successful

WebView Flutter plugin registration on iOS is correct.

The iOS GeneratedPluginRegistrant file now correctly imports the header using <webview_flutter_wkwebview/WebViewFlutterPlugin.h>, and there are no outdated references in the iOS context. The output from our searches confirms that only macOS-generated files still reference “FLTWebViewFlutterPlugin,” which is expected for that platform.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the WebView Flutter plugin header path and registration

# Check if the header file exists at the specified path
fd WebViewFlutterPlugin.h

# Check for any remaining references to the old plugin name
rg "FLTWebViewFlutterPlugin" --type swift --type objc

Length of output: 416

@@ -12,5 +12,5 @@ import webview_flutter_wkwebview
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SecureStorePlugin.register(with: registry.registrar(forPlugin: "SecureStorePlugin"))
FLTWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "FLTWebViewFlutterPlugin"))
WebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "WebViewFlutterPlugin"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Inconsistent WebView Plugin Naming Detected

  • The main file in packages/wallet_kit/macos/Flutter/GeneratedPluginRegistrant.swift registers the plugin as WebViewFlutterPlugin, which is in line with the intended standardization.
  • However, the search shows that example projects (in examples/nft_marketplace and examples/wallet_app) still reference FLTWebViewFlutterPlugin.

It’s recommended to update the example projects to ensure consistency across the repository.

🔗 Analysis chain

Verify WebView Flutter plugin naming consistency.

The change from FLTWebViewFlutterPlugin to WebViewFlutterPlugin appears correct, but let's verify this is consistent with the plugin's actual naming in the Flutter ecosystem.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correct plugin name for webview_flutter_wkwebview

# Check the plugin's pubspec.yaml for the correct plugin class name
rg -A 5 "plugin:" packages/wallet_kit/pubspec.yaml

# Check for any remaining references to the old plugin name
rg "FLTWebViewFlutterPlugin" --type swift --type objc

Length of output: 439

@ptisserand ptisserand merged commit 894e2c4 into focustree:main Feb 3, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant